<#include "../../select.ftl" />
<!DOCTYPE html>
<html>
<head>
    <title>维护页面</title>
    <script type="text/javascript">
        function popAddOrModify(id) {
            var data = {};
            var url = '${absoluteContextPath}/ss/ssCriteria';
            if (id != undefined) {
                data.id = id;
                url = url + "/goEdit";
            } else {
                url = url + "/goAdd";
            }
            $.ajax({
                url:url,
                type:'post',
                data:data,
                success:function(data) {
                    var data = JSON.parse(data);
                    if (data.returnCode == 1) {
                        var pop_div = $('#myModal');
                        pop_div.html(data.content.data);
                        pop_div.modal('show');
                    } else {
                        $.showMessage({parentId:"showMessage",message:"数据加载异常！",type:"success"});
                    }
                }
            });
        }

        function deleteSsCriteria() {
            var i = 0;
            $("input[name=ids]").each(function () {
                if ($(this).prop("checked")) {
                    i++;
                }
            });
            if(i == 0) {
                $.showMessage({parentId:"showMessage",message:"请选择您要删除的记录！",type:"success"});
                return false;
            } else {
                $.confirm({
                    confirm:function() {
                        var values = "";
                        $("input[name=ids]").each(function () {
                            if ($(this).prop("checked")) {
                                values += $(this).val() + ",";
                            }
                        });
                        $("#confirmModal").modal("hide");
                            $.post("${absoluteContextPath}/ss/ssCriteria/delete", {
                            'ids' : values
                        }, function(data) {
                            data = JSON.parse(data);
                            if (data.returnCode == 1) {
                                    $.showMessage({parentId:"showMessage",message:"数据删除成功！",type:"success"});
                                refreshTable();
                            } else {
                                    $.showMessage({parentId:"showMessage",message:"数据删除异常！",type:"error"});
                            }
                        });
                    }
                });
            }
        }
        //详情
        function popView(bookId) {

            $(" #Form_ykTjmx  input[name='recordNo']").val(bookId);

            $("#Form_ykTjmx").submit();
        }

         function refreshTable() {
            $("input[name=currentPage]").val(1);
            $("#search_ssCriteria_table").ajaxSubmit({
                url:'${absoluteContextPath}/ss/ssCriteria/ajaxList',
                success:function(data) {
                    var data = JSON.parse(data);
                    if (data.returnCode == 1) {
                        $("#tableContent").html(data.content.data);
                    } else {
                        $.showMessage({parentId:"showMessage",message:"表格数据加载异常！",type:"success"});
                    }
                }
            });
        }
        $(function () {
            $("input[name=billTime]").focus(function () {
                WdatePicker({dateFmt: 'yyyy-MM-dd'});

            })

            $("input[name=billTimeEnd]").focus(function () {
                WdatePicker({dateFmt: 'yyyy-MM-dd'});

            })

            $("input[name=finishStart]").focus(function () {
                WdatePicker({dateFmt: 'yyyy-MM-dd'});

            })

            $("input[name=finishEnd]").focus(function () {
                WdatePicker({dateFmt: 'yyyy-MM-dd'});
            })
            $("input[name=cyStart]").focus(function () {
                WdatePicker({dateFmt: 'yyyy-MM-dd'});
            })

            $("input[name=cyEnd]").focus(function () {
                WdatePicker({dateFmt: 'yyyy-MM-dd'});
            })
$("div[class='tooltip fade top in']").hide();
        });

        //详情
        function popView(billId) {
            $(" #Form_ssCustomer  input[name='billId']").val(billId);
            $("#Form_ssCustomer").submit();
        }
        function dorefreshBillId(billId) {
            var data = {};
            data.billId = billId;
            var url = '${absoluteContextPath}/ss/ssCriteria';
            url = url + "/dorefreshCrux";
            $.ajax({
                url: url,
                type: 'post',
                data: data,
                success: function (data) {
                    var data = JSON.parse(data);
                    if (data.returnCode == 1) {
                        var pop_div = $('#myModal2');
                        pop_div.html(data.content.data);
                        pop_div.modal('show');
                    } else {
                        $.showMessage({parentId: "errorMessage", message: "数据加载异常！", type: "success"});
                    }
                }
            });
        }
        function popExportExcel() {
            $("#search_ssCriteria_table").attr('action', '${absoluteContextPath}/ss/ssCriteria/export');
            $("#search_ssCriteria_table").submit();
            $("#search_ssCriteria_table").attr('action', '${absoluteContextPath}/ss/ssCriteria/list');
        }
    </script>
</head>
<body>

<div class="breadcrumbs">
    <ol class="breadcrumb">
        <li><a href="${absoluteContextPath}/home"><i class="fa fa-home"></i>首页</a></li>
        <li><a href="#">用户管理</a></li>
        <li class="active">综合查询</li>
    </ol>
</div>

<div class="main">
    <!-- row -->
    <div class="row">
        <div style="display: none">
            <form id="Form_ssCustomer" action="${absoluteContextPath}/ss/ssCustomer/list" method="post">
                     <input name="billId" id="billId" type="text" value=""/>
            </form>
        </div>
        <div class="col-md-12">
            <section class="tile">
                <!-- tile body -->
                <div class="tile-body">
                    <div id="showMessage"><#include "../../message.ftl" /></div>
                    <div class="form-horizontal">
                        <form id="search_ssCriteria_table" action="${absoluteContextPath}/ss/ssCriteria/list" method="post">
                            <#--<input type="hidden" name="pageSize" value="${ssCriteriasTable.page.pageSize}"/>-->
                            <input type="hidden" name="currentPage" value="${ssCriteriasTable.page.currentPage}"/>


                            <div class="row">


                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">客户姓名</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="customerName" value="${ssCriteriaParams.customerName!''}" placeholder="" type="text">
                                    </div>
                                </div>

                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">电话</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="phone" value="${ssCriteriaParams.phone!''}" placeholder="" type="text">
                                    </div>
                                </div>





                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">大类</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="vipType" value="${ssCriteriaParams.vipType!''}" placeholder="" type="text">
                                    </div>
                                </div>

                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">产品名称</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="productName" value="${ssCriteriaParams.productName!''}" placeholder="" type="text">
                                    </div>
                                </div>


                            </div>
                            <div class="row">

                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">下单日期</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="billTime" value="${ssCriteriaParams.billTime!''}" placeholder="" type="text">
                                    </div>
                                </div>
                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">----</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="billTimeEnd" value="${ssCriteriaParams.billTimeEnd!''}" placeholder="" type="text">
                                    </div>
                                </div>
                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">渠道</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="channelType" value="${ssCriteriaParams.channelType!''}" placeholder="" type="text">
                                    </div>
                                </div>
                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">卡号</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="cardId" value="${ssCriteriaParams.cardId!''}" placeholder="" type="text">
                                    </div>
                                </div>
                            </div>
                            <div class="row">

                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">开始日期</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="cyStart" value="${ssCriteriaParams.cyStart!''}" placeholder="" type="text">
                                    </div>
                                </div>
                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">----</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="finishStart" value="${ssCriteriaParams.finishStart!''}" placeholder="" type="text">
                                    </div>
                                </div>
                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">结束日期</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="cyEnd" value="${ssCriteriaParams.cyEnd!''}" placeholder="" type="text">
                                    </div>
                                </div>
                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">----</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="finishEnd" value="${ssCriteriaParams.finishEnd!''}" placeholder="" type="text">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">引荐人</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="yjName" value="${ssCriteriaParams.yjName!''}" placeholder="" type="text">
                                    </div>
                                </div>
                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">促会人</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="chName" value="${ssCriteriaParams.chName!''}" placeholder="" type="text">
                                    </div>
                                </div>
                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">分管人</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" name="fgName" value="${ssCriteriaParams.fgName!''}" placeholder="" type="text">
                                    </div>
                                </div>
                                <div class="form-group col-md-3">
                                    <label class="col-sm-4 control-label" for="exampleInputEmail2">评定结果</label>

                                    <div class="col-sm-8">
                                    <@select name="spareB"  value="${ssCriteriaParams.spareB!''}" list=resultList class="form-control"/>
                                        <#--<input class="form-control" name="vipType" value="${ykOrderParams.vipType!''}" placeholder="" type="text">-->
                                    </div>
                                </div>
                            </div>

                                <div class="row">
                                    <div class="form-group col-md-3">
                                        <label class="col-sm-4 control-label" for="exampleInputEmail2">是否包含指标</label>

                                        <div class="col-sm-8">
                                        <@select name="spareC"  value="${ssCriteriaParams.spareC!''}" list=yesORno class="form-control"/>
                                        <#--<input class="form-control" name="vipType" value="${ykOrderParams.vipType!''}" placeholder="" type="text">-->
                                        </div>
                                    </div>
                                    <div class="form-group col-md-3">
                                        <label class="col-sm-4 control-label" for="exampleInputEmail2">显示条数:</label>
                                        <div class="col-sm-8">
                                            <input class="form-control" name="pageSize" value="${ssCriteriasTable.page.pageSize}" placeholder=""
                                                   type="text"/>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label class="col-sm-4"></label>
                                        <div class="col-sm-8">
                                            <button type="button" class="btn btn-primary" onclick="refreshTable()">查询</button>
                                            <button type="reset" class="btn btn-default">重置</button>
                                        </div>
                                    </div>
                                </div>
                            </form>
                    </div>
                </div>
            </section>
            <section class="tile">
                <div class="tile-header">
                    <h1>
                        <button type="button" class="btn btn-green" onclick="popExportExcel();"><i
                                class="fa fa-plus"></i><span class="margin-left-5">导出</span></button>

                    <#--      <button type="button" class="btn btn-green" onclick="popAddOrModify();"><i class="fa fa-plus"></i><span class="margin-left-5">新增</span></button>
                          <button type="button" class="btn btn-cyan" onclick="deleteSsCriteria();"><i class="fa fa-trash-o"></i><span  class="margin-left-5">删除</span></button>
                    -->  </h1>
                </div>
                <div class="tile-body nopadding">
                    <div class="table-responsive" id="tableContent">
                        <#include "table.ftl"/>
                    </div>
                </div>
            </section>
        </div>
    </div>
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    </div>
    <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    </div>
</div>
</body>
</html>
